package org.jackysoft.opensymphony.workflow;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.SQLException;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.jdbc.Work;

public class TreeNodeDeleteWork implements Work {
	private String id;
	public TreeNodeDeleteWork(String id){
		this.id = id;
	}
	protected final Log log = LogFactory.getLog(TreeNodeDeleteWork.class);
	@Override
	public void execute(Connection connection) throws SQLException {
		String sql = "{ call deleteTreeNode(?) }";
		log.info("删除 编号为 ："+id+" 的树节点 ");
		CallableStatement cs = connection.prepareCall(sql);
        cs.setString(1, id);
        cs.execute();
        log.info("删除完成...");
	}

}
